package com.controllers;

import java.io.IOException;
import java.util.List;

import javax.inject.Named;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.security.core.Authentication;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.web.authentication.AuthenticationSuccessHandler;

public class LoginSuccessHandler 
{
	/*public void onAuthenticationSuccess(HttpServletRequest request,
			HttpServletResponse response, Authentication auth) throws IOException,
			ServletException {
		List<GrantedAuthority> roles = (List<GrantedAuthority>) auth.getAuthorities();
		for (GrantedAuthority grantedAuthority : roles) {
			if (grantedAuthority.getAuthority().equals("ROLE_ADMIN")) {
				response.sendRedirect("pages/secured/dashboard.xhtml");
				return;
			}
			
		}
	
		response.sendRedirect("pages/secured/dashboard.xhtml");
	}*/

}